import { Controller, Get, Param } from "@nestjs/common";
import { OrderDto } from "src/core/dto/order.dto";
import { OrderService } from "src/core/service/order.service";

@Controller('orders')
export class OrderController{
    constructor(private order:OrderService){}
    @Get()
    async findAllOrders():Promise<OrderDto[]>{
        return this.order.findAllOrders();
    }
    @Get(':id')
    async findOrderById(@Param('id') id:string):Promise<OrderDto>{
        return this.order.findOrderById(id);
    }

}